import React from 'react';
import Link from 'umi/link';

class Exception extends React.Component {
  static defaultProps = {
    backText: '返回到首页',
    redirect: '/',
  };
  render() {
    const { type, desc, backText, redirect } = this.props;
    return (
      <div className="error">
        <h1>{type}</h1>
        <p>{desc}</p>
        <p>
          <Link to={redirect}>
            <span>{backText}</span>
          </Link>
        </p>
      </div>
    );
  }
}

export default Exception;
